import fetch from '@/utils/fetch';

export function login(data) {
  return fetch({
    url: '/api/user/login',
    method: 'post',
    data
  })
}

export function getSMSCode(data) {
  return fetch({
    url: '/api/user/get-check-code',
    method: 'post',
    data
  })
}
export function checkUserIsExist(type,user) {
  return fetch({
    url: '/api/user/check-is-exit',
    method: 'post',
    data: {
      type,
      user
    }
  })
}

export function regist(user,regist_type, password) {
  return fetch({
    url: '/api/user/register',
    method: 'post',
    data: {
      regist_type,
      password,
      user
    }
  })
}

export function getInfo(token,uid) {
  return fetch({
    url: '/api/user/get-user-info',
    method: 'post',
    data: {token,uid}
  })
}

export function logout() {
  return fetch({
    url: '/api/user/logout',
    method: 'post'
  })
}

export function checkIsEexit(data) {
  return fetch({
    url: '/api/user/check-is-exit',
    method: 'post',
    data
  })
}

export function sendPWDEmail(data) {
  return fetch({
    url: '/api/user/send-email',
    method: 'post',
    data
  })
}

export function modifyUserInfo(data) {
  return fetch({
    url: 'api/user/modify-user-info',
    method: 'post',
    data
  })
}
